<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:insert="~{include :: header('商品销售明细')}" />
    <th:block th:insert="~{include :: bootstrap-table-css}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
    <div class="btn-group" id="toolbar" role="group">
        <h4>
            成交：
            <span class="text-red" th:text="${orderCount}"></span> 单
            / <span class="text-red" th:text="${orderSum/100}"></span> 元
        </h4>
    </div>
    <table id="bootstrap-table" class="table-striped"></table>
</div>
<th:block th:insert="~{include :: footer}" />
<th:block th:insert="~{include :: bootstrap-table-js}" />
<script th:inline="javascript">
    var authStatusDatas = [[${@dict.getType('qdx_order_detail_state')}]];
    $(function() {
        var options = {
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            url: "/course/order/list.json",
            modalName: "订单流水",
            columns: [
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'orderNo',
                    title: '订单号'
                },
                {
                    field: 'courseName',
                    title: '商品名称'
                },
                {
                    field: 'price',
                    title: '金额',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return row.price / 100;
                    }
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    field: 'authStatus',
                    title: '课程状态',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(authStatusDatas, value);
                    }
                },
                {
                    field: 'payTime',
                    title: '支付时间'
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>